<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		.box{
			width:100px;
			height:100px;
			background-color:gold;
			position:fixed;
			left:20px;
			top:20px;
		}
	</style>
	<script type="text/javascript">
		window.onload = function(){

			var oBox = document.getElementById('box');

			var left = 20;

			var timer = setInterval(function(){

				left+=2;

				oBox.style.left = left + 'px';


				if(left>700)
				{
					clearInterval(timer);
				}



			},30)





		}

	</script>
</head>
<body>
	<div class="box" id="box"></div>
</body>
</html>